﻿using System;
using System.Data;
using System.ComponentModel;
using System.Reflection;

namespace PominaScale
{
	[Serializable]
	public partial class POModel : ModelBase
	{
        public POModel()
        {
            POKey = Guid.NewGuid();
        }

		#region Properties Members
        private Guid _poKey;
        /// <summary>
        /// PO Key Property
        /// </summary>
        public Guid POKey
        {
            get
            {
                return _poKey;
            }
            set
            {
                if (_poKey != value)
                {
                    _poKey = value;
                }
            }
        }

        private string _poCode;
        /// <summary>
        /// PO Code Property
        /// </summary>
        public string POCode
        {
            get
            {
                return _poCode;
            }
            set
            {
                if (_poCode != value)
                {
                    _poCode = value;
                }
            }
        }

		///<summary>
		///Property Active
		///<summary>
		private bool _active;
		public bool Active
		{
			get
			{
				return _active;
			}
			set
			{
				if (_active != value)
				{
					_active = value;
				}
			}
		}
		///<summary>
		///Property ActualWeight
		///<summary>
		private decimal _actualWeight;
		public decimal ActualWeight
		{
			get
			{
				return _actualWeight;
			}
			set
			{
				if (_actualWeight != value)
				{
					_actualWeight = value;
				}
			}
		}
		///<summary>
		///Property ActualWeight2
		///<summary>
		private decimal _actualWeight2;
		public decimal ActualWeight2
		{
			get
			{
				return _actualWeight2;
			}
			set
			{
				if (_actualWeight2 != value)
				{
					_actualWeight2 = value;
				}
			}
		}
		///<summary>
		///Property CreatedByID
		///<summary>
		private string _createdByID;
		public string CreatedByID
		{
			get
			{
				return _createdByID;
			}
			set
			{
				if (_createdByID != value)
				{
					_createdByID = value;
				}
			}
		}
		///<summary>
		///Property CreationDate
		///<summary>
		private DateTime _creationDate;
		public DateTime CreationDate
		{
			get
			{
				return _creationDate;
			}
			set
			{
				if (_creationDate != value)
				{
					_creationDate = value;
				}
			}
		}
		///<summary>
		///Property FirstTime
		///<summary>
		private DateTime? _firstTime;
		public DateTime? FirstTime
		{
			get
			{
				return _firstTime;
			}
			set
			{
				if (_firstTime != value)
				{
					_firstTime = value;
				}
			}
		}
		///<summary>
		///Property FirstWeight
		///<summary>
		private decimal _firstWeight;
		public decimal FirstWeight
		{
			get
			{
				return _firstWeight;
			}
			set
			{
				if (_firstWeight != value)
				{
					_firstWeight = value;
				}
			}
		}
		///<summary>
		///Property Inbound
		///<summary>
		private decimal _inbound;
		public decimal Inbound
		{
			get
			{
				return _inbound;
			}
			set
			{
				if (_inbound != value)
				{
					_inbound = value;
				}
			}
		}
		///<summary>
		///Property InboundWeight
		///<summary>
		private decimal _inboundWeight;
		public decimal InboundWeight
		{
			get
			{
				return _inboundWeight;
			}
			set
			{
				if (_inboundWeight != value)
				{
					_inboundWeight = value;
				}
			}
		}
		///<summary>
		///Property ModifiedByID
		///<summary>
		private string _modifiedByID;
		public string ModifiedByID
		{
			get
			{
				return _modifiedByID;
			}
			set
			{
				if (_modifiedByID != value)
				{
					_modifiedByID = value;
				}
			}
		}
		///<summary>
		///Property ModifiedDate
		///<summary>
		private DateTime _modifiedDate;
		public DateTime ModifiedDate
		{
			get
			{
				return _modifiedDate;
			}
			set
			{
				if (_modifiedDate != value)
				{
					_modifiedDate = value;
				}
			}
		}
		///<summary>
		///Property PodAte
		///<summary>
		private DateTime? _poDate;
        public DateTime? PODate
		{
			get
			{
                return _poDate;
			}
			set
			{
                if (_poDate != value)
				{
                    _poDate = value;
				}
			}
		}
		///<summary>
		///Property PoID
		///<summary>
		private string _poID;
		public string PoID
		{
			get
			{
				return _poID;
			}
			set
			{
				if (_poID != value)
				{
					_poID = value;
				}
			}
		}
		///<summary>
		///Property PoType
		///<summary>
		private int? _poType;
        public int? PoType
		{
			get
			{
                return _poType;
			}
			set
			{
                if (_poType != value)
				{
                    _poType = value;
				}
			}
		}
		///<summary>
		///Property ProductID
		///<summary>
		private string _productID;
		public string ProductID
		{
			get
			{
				return _productID;
			}
			set
			{
				if (_productID != value)
				{
					_productID = value;
				}
			}
		}
		///<summary>
		///Property ProductName
		///<summary>
		private string _productName;
		public string ProductName
		{
			get
			{
				return _productName;
			}
			set
			{
				if (_productName != value)
				{
					_productName = value;
				}
			}
		}
		///<summary>
		///Property SecondTime
		///<summary>
		private DateTime? _secondTime;
		public DateTime? SecondTime
		{
			get
			{
				return _secondTime;
			}
			set
			{
				if (_secondTime != value)
				{
					_secondTime = value;
				}
			}
		}
		///<summary>
		///Property SecondWeight
		///<summary>
		private decimal _secondWeight;
		public decimal SecondWeight
		{
			get
			{
				return _secondWeight;
			}
			set
			{
				if (_secondWeight != value)
				{
					_secondWeight = value;
				}
			}
		}
		///<summary>
		///Property SeqInbound
		///<summary>
		private int _seqInbound;
		public int SeqInbound
		{
			get
			{
				return _seqInbound;
			}
			set
			{
				if (_seqInbound != value)
				{
					_seqInbound = value;
				}
			}
		}
		///<summary>
		///Property Unit
		///<summary>
		private string _unit;
		public string Unit
		{
			get
			{
				return _unit;
			}
			set
			{
				if (_unit != value)
				{
					_unit = value;
				}
			}
		}
		///<summary>
		///Property Unit2
		///<summary>
		private string _unit2;
		public string Unit2
		{
			get
			{
				return _unit2;
			}
			set
			{
				if (_unit2 != value)
				{
					_unit2 = value;
				}
			}
		}
		///<summary>
		///Property VendorID
		///<summary>
		private string _vendorID;
		public string VendorID
		{
			get
			{
				return _vendorID;
			}
			set
			{
				if (_vendorID != value)
				{
					_vendorID = value;
				}
			}
		}
		///<summary>
		///Property VendorName
		///<summary>
		private string _vendorName;
		public string VendorName
		{
			get
			{
				return _vendorName;
			}
			set
			{
				if (_vendorName != value)
				{
					_vendorName = value;
				}
			}
		}

        ///<summary>
        ///Property VehicleID
        ///<summary>
        private string _vehicleID;
        public string VehicleID
        {
            get
            {
                return _vehicleID;
            }
            set
            {
                if (_vehicleID != value)
                {
                    _vehicleID = value;
                }
            }
        }

        ///<summary>
        ///Property WBS
        ///<summary>
        private string _wbs;
        public string WBS
        {
            get
            {
                return _wbs;
            }
            set
            {
                if (_wbs != value)
                {
                    _wbs = value;
                }
            }
        }

        ///<summary>
        ///Property Location
        ///<summary>
        private string _location;
        public string Location
        {
            get
            {
                return _location;
            }
            set
            {
                if (_location != value)
                {
                    _location = value;
                }
            }
        }

        ///<summary>
        ///Property HasFirstWeight
        ///<summary>
        public bool HasFirstWeight
        {
            get
            {
                return _firstWeight > 0;
            }
        }

        ///<summary>
        ///Property HasSecondWeight
        ///<summary>
        public bool HasSecondWeight
        {
            get
            {
                return _secondWeight > 0;
            }
        }
        ///<summary>
        ///Property ScaleTime1
        ///<summary>
        public string ScaleTime1
        {
            get
            {
                return _firstTime.HasValue ? String.Format("{0:d} {0:HH:mm}", _firstTime.Value) : "";
            }
        }

        ///<summary>
        ///Property ScaleTime2
        ///<summary>
        public string ScaleTime2
        {
            get
            {
                return _secondTime.HasValue ? String.Format("{0:d} {0:HH:mm}", _secondTime.Value) : "";
            }
        }

        public string ScaleDate1
        {
            get
            {
                return _firstTime.HasValue ? String.Format("{0:d}", _firstTime.Value) : String.Empty;
            }
        }

        public string ScaleDate2
        {
            get
            {
                return _secondTime.HasValue ? String.Format("{0:d}",_secondTime.Value) : String.Empty;
            }
        }

        ///<summary>
        ///Property GroupTime
        ///<summary>
        public string GroupTime
        {
            get
            {
                return _secondTime.HasValue ? String.Format("{0:d}", _secondTime.Value) : "";
            }
        }

        ///<summary>
        ///Property POType String
        ///<summary>
        public string StringPOType
        {
            get
            {
                return _poType == 1 ? "NHẬP HÀNG" : (_poType == 2 ? "XUẤT HÀNG" : "");
            }
        }

        ///<summary>
        ///Property I/O String
        ///<summary>
        public string StringIOType
        {
            get
            {
                return _poType == 1 ? "Inbound" : (_poType == 2 ? "Outbound" : "");
            }
        }
        /// <summary>
        /// Property Series number
        /// </summary>
        private string _seriesnumber;
        public string SeriesNumber
        {
            get
            {
                return _seriesnumber;
            }
            set
            {
                if (_seriesnumber != value)
                {
                    _seriesnumber = value;
                }
            }
        }
		#endregion

	}
}
